# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=libqmi
pkgver=1.32.4
pkgrel=1
pkgdesc="QMI modem protocol helper library"
url="https://www.freedesktop.org/wiki/Software/libqmi/"
arch=(x86_64)
license=(GPL2)
depends=(libmbim libqrtr-glib libgudev)
makedepends=(gtk-doc meson git help2man gobject-introspection bash-completion)
provides=(libqmi-glib.so)
_commit=6e248aceb66f53b467b343bca1c467a8211dd30d  # tags/1.32.4^0
source=("git+https://gitlab.freedesktop.org/mobile-broadband/libqmi.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd libqmi
  git describe --tags | sed 's/-rc/rc/;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd libqmi
}

build() {
  arch-meson libqmi build -D gtk_doc=true
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
